<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title></title>
	<link rel="stylesheet" type="text/css" href="../../../resource/css/bootstrap.min.css"/>
	<link rel="stylesheet" type="text/css" href="../../../resource/css/jedate.css"/>
	<link rel="stylesheet" type="text/css" href="../../../resource/fonts/iconfont.css"/>
	<link rel="stylesheet" type="text/css" href="../../../resource/css/common.css"/>
	<style>
	</style>
</head>
<body>
<div class="container-fluid">
	<div class="row mheader">
		<div class="col-xs-2 text-left"><a href="javascript:;" onclick="javascript:history.back(-1);"><span class="iconfont icon-fanhui"></span></a></div>
		<div class="col-xs-8"><h2>申请审批详情</h2></div>
	</div>
	<div class="row">
		<dl class="erp-list erp-details">
			<dd>
				<div id="dd1" class="erp-txt visa-txt">
				</div>
			</dd>
		</dl>
		<dl id="d2" class="erp-order material-order">
			<dt>材料单</dt>

			<!--<dd>-->
			<!--<p><span>材料名称:</span>水泥</p>-->
			<!--<div class="order-li clearfix">-->
			<!--<div class="col-xs-6"><span>规格:</span>100x200</div>-->
			<!--<div class="col-xs-6 text-right"><span>数量:</span><strong>20</strong><span>个</span></div>-->
			<!--<div class="col-xs-6"><span>单位:</span>t</div>-->
			<!--<div class="col-xs-6 text-right"><span>备注:</span><strong>正常</strong><span></span></div>-->
			<!--</div>-->
			<!---->
			<!--</dd>-->

		</dl>


		<div style="margin-bottom: 80px;"></div>
		<div id="sh" class="order-send hidden"><button onclick="sub()" class="btn btn-warning">审批</button></div>

	</div>
</div>
</body>
</html>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="../../../resource/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../resource/js/style.js"></script>
<script src="../../../resource/js/base64.js"></script>
<script type="text/javascript">

    var danhao;
    //点击改变申请单高度
    $(document).ready(function(){
        $(".more").click(function(){
            $(this).siblings(".order-li").toggleClass("orderHeight");
        });

        var feed_Code=window.location.href.split("?")[1];
        danhao=feed_Code;
        var sendata = {'type':'c'};
        sendata['remark'] = feed_Code;
        sendata['p'] = getP();
        ajaxs(
            "api/matperson/gcMatFeedSel.do", "post", sendata,
            function (data) {
                dropDown = data.fullDown;
                var data = data.data;
                console.log(data)
                $('#dd1').append('<p><span >供货单号:</span>'+data[0].feed_Code+'</p>'+
                    '<p class="clearfix"><span class="sp">项目名称:</span><span class="divCon">'+data[0].eppName+'('+data[0].eppStaEnd+')'+'</span></p>'+
                    '<p class="clearfix"><span class="sp">施工单位:</span><span class="divCon">'+data[0].compName1+'</span></p>'+
                    '<p><span>供货时间:</span>'+data[0].supply_Time+'</p>'+
                    '<p><span>收货地址:</span>'+data[0].eppStaEnd+'</p>'
                );
                if(data[0].validate == '-1'){
                    $('#sh').removeClass('hidden');
                }
                var htmls= '';
                for (var i=0; i < data.length;i++){
                    d = data[i];
                    var dw = '';
                    switch (d.validate) {             //判断状态
                        case -1:
                            d.validate = '审核中';
                            break;
                        case 0:
                            d.validate = '通过';
                            break;
                        case 1:
                            d.validate = '不通过';
                            break;
                        case 2:
                            d.validate = '已发货';
                            break;
                    };


                    console.log(d);
                    var model = '<dd class="myfrom-sub">' +
                        '<p><span>材料名称:</span>'+d.mat_Name+'</p>' +
                        '<div class="order-li clearfix">' +
                        '<div class="col-xs-7 clearfix"><span>材料规格:</span>'+d.mat_Spec+'</div>' +
                        '<div class="col-xs-5 clearfix"><span>申请人:</span>'+d.feed_sqr+'</div>' +
                        '<div class="col-xs-7 clearfix"><span>申请数量:</span>'+d.feed_Num+d.mat_Bit+'</div>' +
                        '<div class="col-xs-5 clearfix"><span>审核量:</span>'+d.fv_Num+d.mat_Bit+'</div>' +
                        '<div class="col-xs-12 clearfix"><span>材料供应商:</span>'+d.compName+'</div>' +
                        '<div class="col-xs-12 clearfix"><span>审核状态:</span>'+d.validate+'</div>' +
                        '<div class="col-xs-12 clearfix"><span>审核意见:</span>'+d.valOpition+'</div>' +
                        '<span class="hidden mat_Id">'+d.mat_Id+'</span>'+
                        '<span class="hidden id">'+d.id+'</span>'+
                        '</div>' +
                        '</dd>';

                    switch (d.mat_Type){
                        case 1:
                            for (var j=0;j<dropDown.fullDown1.length;j++){
                                dw += '<option value="'+dropDown.fullDown1[j].compid+'">'+dropDown.fullDown1[j].compName+'</option>'
                            }
                            break;
                        case 2:
                            for (var j=0;j<dropDown.fullDown2.length;j++){
                                dw += '<option value="'+dropDown.fullDown2[j].compid+'">'+dropDown.fullDown2[j].compName+'</option>'
                            }
                            break;
                        case 3:
                            for (var j=0;j<dropDown.fullDown3.length;j++){
                                dw += '<option value="'+dropDown.fullDown3[j].compid+'">'+dropDown.fullDown3[j].compName+'</option>'
                            }
                            break;
                        case 4:
                            for (var i=0;i<dropDown.fullDown4.length;i++){
                                dw += '<option value="'+dropDown.fullDown4[i].compid+'">'+dropDown.fullDown4[i].compName+'</option>'
                            }
                            break;
                    }

                    model = model
                        .replace('{{dorpDown}}',dw)
                        .replace('{{fv_num}}',(d.fv_Num ==undefined)?d.feed_Num:d.fv_Num);
                    htmls += model;

                }
                $('#d2').html($('#d2').html()+htmls);

				$('input').attr('disabled','disabled');

            }
        )


    });



</script>











